import React from 'react';
import { Card, Modal, Button } from 'antd';
import DescriptionList from '../../components/DescriptionList';

const { Description } = DescriptionList;
class vehicleDetailModel extends React.PureComponent {
  render() {
    const deviceStatus = ['出厂', '销售', '激活', '替换', '报废'];
    const enrollStatus = ['', '成功', '失败', '进行中'];
    const { changeVisible, detailModelData } = this.props;
    return (
      <Modal
        title=""
        style={{ top: 20 }}
        width="40%"
        visible={this.props.visible}
        onCancel={() => changeVisible()}
        footer={[
          <Button key="back" type="primary" size="default" onClick={() => changeVisible()}>
            返回
          </Button>,
        ]}
      >
        <div style={{ background: '#ECECEC', marginTop: 30 }}>
          <Card title="详细信息" bordered={false} type="inner">
            <DescriptionList title="">
              <Description term="设备ID"style={{ width: '50%' }}>{detailModelData.deviceId}</Description>
              <Description term="设备名称"style={{ width: '50%' }}>{detailModelData.deviceName}</Description>
              <Description term="硬件版本号"style={{ width: '50%' }}>{detailModelData.versionHardware}</Description>
              <Description term="软件版本号"style={{ width: '50%' }}>{detailModelData.versionSoftware}</Description>
              <Description term="批次号"style={{ width: '50%' }}>{detailModelData.batchNo}</Description>
              <Description term="设备状态"style={{ width: '50%' }}>{deviceStatus[detailModelData.deviceStatus]}</Description>
              <Description term="IMEI"style={{ width: '50%' }}>{detailModelData.imei}</Description>
              <Description term="激活状态"style={{ width: '50%' }}>{enrollStatus[detailModelData.enrollStatus]}</Description>
              <Description term="激活日期"style={{ width: '50%' }}>{detailModelData.enrollDate}</Description>
              <Description term="生产日期"style={{ width: '50%' }}>{detailModelData.produceDate}</Description>
              <Description term="WIFI账户"style={{ width: '50%' }}>{detailModelData.ssid}</Description>
              <Description term="WIFI密码"style={{ width: '50%' }}>{detailModelData.pin}</Description>
              <Description term="蓝牙ID"style={{ width: '50%' }}>{detailModelData.bluetoothId}</Description>
              <Description term="蓝牙MAC"style={{ width: '50%' }}>{detailModelData.bluetoothMac}</Description>
              <Description term="蓝牙名称"style={{ width: '50%' }}>{detailModelData.bluetoothName}</Description>
              <Description term="定位蓝牙ID"style={{ width: '50%' }}>{detailModelData.locBluetoothIds}</Description>
              <Description term="入库时间"style={{ width: '50%' }}>{detailModelData.createDate}</Description>
            </DescriptionList>
          </Card>
        </div>
      </Modal>
    );
  }
}

export default vehicleDetailModel;
